Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely fix bash autocomplete handling of filenames with spaces #9708

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Completely fix bash autocomplete handling of filenames with spaces #9708

merged 1 commit into from
Feb 24, 2024

Conversation

wr7
Copy link
Contributor

@wr7 wr7 commented Feb 23, 2024

I made an PR earlier (#9702) to fix issue #9701, but it seems that I forgot to wrap a $2 in quotes and escape the quotes in some of the lines above. With this mistake, most of the behavior when filenames include spaces still works properly, but some problems still occur when multiple file paths are similar and contain spaces.

Broken behavior

  • Assume the current directory contains the file "foo bar.txt" and "foo biz.txt"
  • hx foo\ ba + Tab autocompletes to hx foo\ b
  • hx foo\ biz + Tab autocompletes to hx foo\ b

New behavior

  • hx foo\ ba + Tab autocompletes to hx foo\ bar.txt
  • hx foo\ biz + Tab autocompletes to hx foo\ biz.txt

Testing

  • This change can be tested by replacing the contents of /usr/share/bash-completion/completions/hx with the new contents of contrib/completion/hx.bash.

Fix additional bug when file names contain spaces.

## Broken behavior 
 - Assume the current directory contains the file "foo bar.txt" and "foo biz.txt"
 - `hx foo\ ba` + `Tab` autocompletes to `hx foo\ b`
## New behavior
 - `hx foo\ ba` + `Tab` autocompletes to `hx foo\ bar.txt`
@the-mikedavis the-mikedavis added the S-waiting-on-review Status: Awaiting review from a maintainer. label Feb 23, 2024
@archseer archseer merged commit 38484f3 into helix-editor:master Feb 24, 2024
6 checks passed
@wr7 wr7 deleted the fix-bash-autocomplete branch February 24, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants